<?php
require_once( 'need.inc.php' );
$user_id = Login::NeedLogin();

/* set */
$pageSize = 20;
$pageNo = 1;
/* end set */

$table = 'health_info';

$sql = "SELECT COUNT(1) AS count FROM `$table` ";

$r = DB::GetQueryResult($sql, true);
$count = abs(intval($r['count']));

$condition = null;
$pageNo = isset($_GET['pagenum'])?$_GET['pagenum']:1;
$offset = ($pageNo-1) * $pageSize;

$lists = DB::LimitQuery( $table, array(
			'condition' => $condition, 
			'size' => $pageSize, 
			'offset' => $offset,
			));
$pager = new Pager(array(
			'rowCount' => $count,
			'pageSize' => $pageSize,
			));
Template::Assign( $_GET );

Template::Display( 'health_info', array(
			'lists' => $lists,
			'pager' => $pager->paginate(),
			'table' => $table,
			));
?>
